import { BasicColumn } from '/@/components/Table';
import { JVxeTypes, JVxeColumn } from '../../../components/base/JVxeTable/types';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '表单名称',
    align: 'center',
    dataIndex: 'title',
  },
  {
    title: '表单编码',
    align: 'center',
    dataIndex: 'pageKey',
  },
  {
    title: '访问地址',
    align: 'center',
    dataIndex: 'viewPath',
  },
];

//子表单数据

// 元素类型
export const elementTypes = [
  {
    title: '元素',
    value: 'element',
  },
  {
    title: '按钮',
    value: 'button',
  },
];
//子表表格配置
export const onlCgformApprovePageElementColumns: JVxeColumn[] = [
  {
    title: '字段名',
    key: 'elementId',
    type: JVxeTypes.input,
    placeholder: '请输入${title}',
    defaultValue: '',
    width: '300px',
    validateRules: [{ required: true, message: '${title}不能为空' }],
  },
  {
    title: '元素名称',
    key: 'name',
    type: JVxeTypes.input,
    placeholder: '请输入${title}',
    defaultValue: '',
    width: '200px',
  },
  {
    title: '元素类型',
    key: 'type',
    type: JVxeTypes.select,
    options: elementTypes,
    width: '120px',
    placeholder: '请输入${title}',
    defaultValue: '',
    validateRules: [{ required: true, message: '${title}不能为空' }],
  },
  {
    title: '上级元素',
    key: 'parentElementId',
    type: JVxeTypes.select,
    options: [],
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    align: 'center',
    title: '是否启用',
    key: 'isEnable',
    type: JVxeTypes.checkbox,
    customValue: [1, 0],
    placeholder: '请输入${title}',
    defaultValue: '',
    width: '100px',
    validateRules: [{ required: true, message: '${title}不能为空' }],
  },
];
